feat(motor): add readback tolerance check to EpicsMotor.move() - #107
feat(motor): add readback tolerance check to EpicsMotor.move()#107mrlo03 wants to merge 1 commit into
Conversation
Extend the `move` method in `ReadbackEpicsMotor` to ensure motion completion depends not only on the standard motion status (`.DMOV`), but also on whether the actual readback (`user_readback`) is within the defined `tolerance` from the target position. Signed-off-by: Murilo Theodoro Moreira Santos murilo.moreira@lnls.br
|
What is the reasoning behind adding this class instead of relying on Also, does this behavior occur in a specific IOC device? Since this is clearly a bug, it'd be nice if we could have it fixed in the lower level instead of working around it here. |
RafaelLyra8
left a comment
There was a problem hiding this comment.
I like the idea of also watching for the readback value as a default implementation, but I think that the tolerance might be a lot more complicated to handle than just setting a default value, as different motors have different tolerances this may cause errors in the already implemented plans. Also, it would be nice to implement the tolerance as atol(absolute tolerance) and rtol(relative tolerance) as its already done in the EpicsSignal and PVPositioner implementations.
I couldn't find a straightforward way to use With this approach, I think we can better preserve the But we can talk to find a better way to implement this. What do you think? Regarding the IOC, I encountered this issue with the CNB motors using DeltaTau (PB01, PB02, etc.) and with the new controller for the 4CM (CK5M01). I can confirm with Ana and the IOC team whether this bug also occurs in other contexts. However, I still think it would be useful to keep both checks, using |
I think the main issue with using the RBV value for checking movement state is that you become less robust on other issues, like if the motor gets stuck for some reason. In those cases, the This can be seen in this piece of code from EpicsMotor itself, where the Aside from that consideration, another important thing is that if the |
That makes sense Sofia. In cases where the motor gets stuck for some reason, we would have to rely on the configured timeout, which can vary from motor to motor. What do you think about implementing a check for |
Create an
EpicsMotorsubclass (ReadbackEpicsMotor) that includes readback tolerance checking. This motor extends the standardEpicsMotorto ensure that a move operation does not complete until both the standard motion status (.DMOV) and the actual readback value (user_readback) are within a specifiedtolerancefrom the target position.This change addresses an issue during scans where the IOC reports via the
.DMOVfield that the movement has finished, while the motor is actually still moving. Checking the.RBV(user_readback) value is used here as a reliable solution to ensure the move is truly complete.